#ifndef  __IDXBUILDER_H_
#define  __IDXBUILDER_H_

#include "common.h"
#include "termlist.h"


class IdxBuilder {
public:
  IdxBuilder() {
    memset(&m_head, 0, sizeof(idx_index_t));
    m_index = NULL;
    m_count = NULL;
    m_offset = NULL;
  }
  ~IdxBuilder() {
    if(m_index)free(m_index);
    if(m_count)free(m_count);
    if(m_offset)free(m_offset);
  }

  void build_idx_info(link_list* list);
  void dump_idx_info(FILE* fp);
  void free_idx_info();
private:
  idx_head_t m_head;

  idx_index_t* m_index;
  idx_count_t* m_count;
  offset_t*    m_offset;
};













#endif  //__IDXBUILDER_H_
